1. Field of the Invention
The present invention relates to disk drives for computer systems. More particularly, the present invention relates to a disk drive allocating cache segments by mapping bits of a command size into corresponding segment pools.
2. Description of the Prior Art
A disk drive typically comprises a cache memory for caching data written to the disk as well as data read from the disk. The overall performance of the disk drive is affected by how efficiently the cache memory can be allocated for a host command. In the past, the cache memory has been divided into cache segments each comprising a number of blocks (e.g., eight blocks), wherein the cache system would allocate a number of cache segments to process the host command. This technique is inefficient, however, if the number of blocks in a cache segment does not integer divide into the number of blocks associated with processing the host command leaving part of a cache segment allocated but unused.